package com.izliang.gateway.client.goods;

import model.Goods;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.stereotype.Service;
import service.GoodsService;

@Service
public class GoodsClient {

    @Reference(loadbalance = "roundrobin", cluster = "failfast", check = false,mock = "com.izliang.gateway.client.goods.GoodsClientCallBack")
    private GoodsService goodsService;

    public Goods getGoods(int id) {
        return goodsService.findGoodsInfoById(id);
    }

    public void subGoodsStock(){  goodsService.subGoodsStock();}
}
